package com.pkcargo.entity.search;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import com.pkcargo.entity.user.User;
import com.pkcargo.entity.IdEntity;

import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: Howard
 * Date: 2009-4-25
 * Time: 14:00:12
 * To change this template use File | Settings | File Templates.
 */
@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "Metadatas")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Metadata extends IdEntity {
    private User user;
    private String title;
    private Date captureTime;
    private Date publishTime;
    private Date validTime;
    private String allContent;
    private String url;
    private int type; //货盘=1 运价=2 合作=3
    private boolean valid; //标记数据的唯一性，保证另外的子表有数据

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "USER_ID")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Date getValidTime() {
        return validTime;
    }

    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getCaptureTime() {
        return captureTime;
    }

    public void setCaptureTime(Date captureTime) {
        this.captureTime = captureTime;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public String getAllContent() {
        return allContent;
    }

    public void setAllContent(String allContent) {
        this.allContent = allContent;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public boolean isValid() {
        return valid;
    }

    public void setValid(boolean valid) {
        this.valid = valid;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
